<?php

use Illuminate\Database\Seeder;
use App\System\Cms\Model\CmsMsg;
use Faker\Factory;

class CmsMsgTableSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run(CmsMsg $CmsMsg)
    {
        //先清空表
        $CmsMsg->truncate();
        //实例化faker类
        $faker = Factory::create('zh_CN');//生成中文数据
        //循环
        for ($i = 0; $i < 30; $i++) {
            $CmsMsg->insert([
                'article_id' => $i + 1,
                'status'     => mt_rand(1, 4),
                'plan_time'  => date('Y-m-d H:i:s', time()),
                'admin_id'   => '1',
                'created_at' => date('Y-m-d H:i:s', time()),
            ]);
        }
    }
}
